#include <iostream>

using std::cout;
using std::endl;

class Base
{
friend Base operator+(const Base& lhs, const Base& rhs);
friend bool operator==(const Base& lhs, const Base& rhs);
public:
    Base(int i = 0)
        : _i(i){}

private:
    int _i;
};

Base operator+(const Base& lhs, const Base& rhs){
    return Base(lhs._i + lhs._i);
}

bool operator==(const Base& lhs, const Base& rhs){
    return lhs._i - rhs._i;
}

int main(void)
{
    // 编写Base类使下列代码输出为1

    int i=2;
    int j=7;

    Base x(i);
    Base y(j);
    cout << (x + y == j - i) << endl;
    // 提示：本题考查的其实就是运算符重载的知识点。
}